#///////////////////////////////////////////////////////////////////////////////
##.. module:: plot.qtsa
#  
# Plot time series.    
#
# Parameters
# !!!!!!!!!!
#   lower *(optional)*
#       Lower bound of datetime field. Defaults to the minimum datetime.
#
#   upper *(optional)*
#       Upper bound of datetime field. Defaults to the maximum datetime.
#
#   slice *(optional)*
#       Slice the data: for example, if *slice=10*, sample every tenth 
#       data point.
#
#   data *(optional)*
#       The data to be plotted.  If you don't provide this
#       then the data is read based on *lower* and *upper*.
#
# R usage
# !!!!!!!
# ::
#  
#     # plot everything up to 2010-08-02, including every tenth data point. 
#     plot.qsta(upper='2010-08-02', slice=10) 
#
#     # plot everything in 'data', including every other data point
#     plot.qsta(data, slice=2) 
#
# .. codeauthor:: Joe Kwiatkowski
##
#///////////////////////////////////////////////////////////////////////////////
plot.qsta<-function(lower=1, upper=1, slice=1, data=1) {
    if (is.numeric(data))
        data=readFromDB(lower, upper)
    # Slice the data:
    if (slice!= 1)
        data=data[seq(1,length(data[,1]),by=slice),]
    plot(data$dateTime, data$kW, type='l', xlab='')
}
